package edu.drexel.jrexel2d.networking.sync;

import java.io.Serializable;
import java.util.Map;

import edu.drexel.jrexel2d.objects2D.Point2D;

public class ServerGameUpdate implements Serializable {
	private Map<Integer, Point2D> updatedObjects;
	private Map<Integer, Long> timeOfPlayerUpdates;
	private Point2D backdropLocation;

	//last player update
	public Map<Integer, Long> getTimeOfPlayerUpdates() {
		return timeOfPlayerUpdates;
	}

	public void setTimeOfPlayerUpdates(Map<Integer, Long> timeOfPlayerUpdates) {
		this.timeOfPlayerUpdates = timeOfPlayerUpdates;
	}

	public ServerGameUpdate(Map<Integer, Point2D> updatedObjects,
			Map<Integer, Long> timeOfPlayerUpdates, Point2D backdropLocation) {
		super();
		this.updatedObjects = updatedObjects;
		this.timeOfPlayerUpdates = timeOfPlayerUpdates;
		this.backdropLocation = backdropLocation;
	}

	public Map<Integer, Point2D> getUpdatedObjects() {
		return updatedObjects;
	}

	public void setUpdatedObjects(Map<Integer, Point2D> updatedObjects) {
		this.updatedObjects = updatedObjects;
	}

	public Point2D getPlayerByObjectId(int id) {
		return updatedObjects.get(id);
	}

	public Point2D getBackdropLocation() {
		return backdropLocation;
	}

	public void setBackdropLocation(Point2D backdropLocation) {
		this.backdropLocation = backdropLocation;
	}
}
